<script setup lang="ts">
import useLoginStore from '@/store/login/login'
import { mapPathToMenuForBreadCrumb } from '@/utils/map-menus'
import { computed } from 'vue'
import { useRoute } from 'vue-router'

const { userMenu } = useLoginStore()
const route = useRoute()
// watch
const breadcrumb = computed(() => {
  return mapPathToMenuForBreadCrumb(userMenu, route.path)
})
// console.log(breadcrumb)
</script>
<template>
  <el-breadcrumb separator-icon="ArrowRight">
    <template v-for="item in breadcrumb" :key="item.name">
      <el-breadcrumb-item :to="item.path">{{ item.name }}</el-breadcrumb-item>
    </template>
  </el-breadcrumb>
</template>
<style scoped lang="less"></style>
